use serde::Deserialize;
use std::collections::HashMap;

// view Resource as asset
#[derive(Deserialize)]
pub struct AssetIndex {
  pub id: String,
  pub sha1: String, // SHA 1
  pub size: u32,
  #[serde(alias = "totalSize")]
  pub total_size: u32,
  pub url: String, // asset file url
}

#[derive(Deserialize)]
pub struct Index {
  pub objects: HashMap<String, Object>, // "xxx" : {obj}
}

#[derive(Deserialize)]
pub struct Object {
  pub hash: String,
  pub size: u32,
}
